package com.zr.controller;
/**
 *   @author   CY
 */

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.zr.service.UserService;
import com.zr.serviceImpl.UserServiceImpl;

import net.sf.json.JSONObject;

public class GetOverTimeUserControllerdtp extends HttpServlet{
	UserService user=new UserServiceImpl();
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		doPost(req, resp);
	}
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		req.setCharacterEncoding("utf-8");
		resp.setCharacterEncoding("utf-8");
		int page=Integer.parseInt(req.getParameter("page"));
		int rows=Integer.parseInt(req.getParameter("rows"));
		String opinion=req.getParameter("opinion");
		JSONObject j=user.findOverTimeUser(page, rows,opinion);
		PrintWriter pw=resp.getWriter();
		pw.write(j.toString());
		pw.flush();
		pw.close();
	}
}
